package com.yq.day74.danli.v5;



/**
 * @author 3307235355@qq.com
 * @description
 * @since 2022/07/04 11:16
 *
 */

//静态内部类实现类的懒加载
public class Singleton5 {


    private static Singleton5 instance;

    //私有化构造方法
    private Singleton5() {
    }

    static Singleton5 get(){
        return Inner.inner();
    }

    static class Inner{
        static {
            instance =new Singleton5();
        }
        static Singleton5 inner(){
            return instance;
        }
    }
}



